﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

public partial class topframe : System.Web.UI.Page
{
    public string DBName = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        string connectionstring = ConfigurationManager.ConnectionStrings["DBConn"].ConnectionString;
        int start = connectionstring.IndexOf("database");
        int end = connectionstring.IndexOf("uid");
        if (connectionstring.Contains("172.16.100.64"))
        {
            DBName = "(正式库)"; 
        }
        else if (connectionstring.Contains("172.16.100.123"))
        {
            DBName = "(开发库:" + connectionstring.Substring(start+9,end - start - 10) + ")";
        }
        else if (connectionstring.Contains("172.16.100.24"))
        {
            DBName = "(测试库:" + connectionstring.Substring(start + 9, end - start - 10) + ")";
        }
        else
        {
            DBName = "(???)";
        }
    }
}